<template>
  <view class="container">
    <view class="search cu-bar">

      <view class="search-form round">
		   <view class="icon" @tap="getaddress">
			  {{ address }}
			</view>
				<text class="lg cuIcon-location"></text>
        <text class="cuIcon-search"></text>
        <input
          type="text"
          class="searchInput"
          placeholder-class="placeholder"
		  placeholder="搜索职位/公司"
          confirm-type="search"
          :adjust-position="false"
		  v-model="searchText"
		  @input="seaechF"
        />
      </view>
    </view>
  </view>
</template>

<script>
	const Page = require('../../../utils/mtj-wx-sdk.js').Page;
export default {
  name: "SearchBar",
  props:{
	  address: {
	  	type: String,
	  	default: '常州'
	  },
  },
  data() {
    return {
      searchText: "",
	  // address: "常州"
    };
  },
  methods:{
	  seaechF(e){
		  this.$emit('searchFun',e.detail.value);
	  },
	  getaddress(){
		  // this.$emit("openpop")
	  }
  },
  mounted() {
  	this.address = this.$store.state.address;
  }
};
</script>

<style scoped>
.container {
  display: flex;
  height: 40px;
  position: relative;
  padding: 0 16px;
}

.icon {
  font-size: 16px;
  font-weight: 400;
  color: #333333;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 22px;
  padding-left: 16px;
}

.cuIcon-location {
  margin-right: 3px;
}
.cu-bar{
	min-height: 0px;
}
.search {
	background: #FFFFFF;
	box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.08);
	height: 40px;
	margin: 0 auto;
	border-radius: 4px;
	display: flex;
	width: 100%;
}

.search-form {
	background: #FFFFFF;
	width: 100%;
}

.cuIcon-search,
.placeholder {
  font-size: 14px;
  font-weight: 400;
  color: #B6B6B6;
  line-height: 20px;
}

.search-form {
  padding: 0;
  margin: 0;
}

.cu-bar .search-form input {
	z-index: 99;
	padding: 0;
}
search-form::placeholder,
input.searchinput::placeholder {
  color: #b9deff;
}
</style>
